<template>
  <footer class="footer">
    <span class="todo-count">剩余<strong>数量值</strong></span>
    <ul class="filters">
      <li>
        <a class="selected" href="javascript:;" >全部</a>
      </li>
      <li>
        <a href="javascript:;">未完成</a>
      </li>
      <li>
        <a href="javascript:;" >已完成</a>
      </li>
    </ul>
    <button class="clear-completed" @click="deletefn">清除已完成</button>
  </footer>
</template>

<script>
import axios from 'axios'
export default {
  data () {
    return {
      deleteisdone: false
    }
  },
  props: ['arr'],
  methods: {
    deletefn () {
      const deleArr = this.arr.filter(item => item.completed === true)
      if (!deleArr.length === 0) {
        axios({
          url: 'deleteall',
          method: 'delete'
        }).then(res => { console.log(res) })
      }
    }
  }
}
</script>
